<?php
/*
 * a simple example how to invoke commands using SOAP
 */

var $soapSettings = array(
        "IP"            => "yourdomain.com", //Your server's IP address
        "PORT"          => 7878, //7878 is the default Port
        "USERNAME"      => "USERNAMEGOESHERE", //Must be in UPPERCASE in both, Database AND This file
        "PASSWORD"      => "PASSWORDGOESHERE", //Password of the account give above
        "DEBUG"         => true, //If "True" then errors will be printed in html and if false ... They'll only be printed in file
);
         
function executeCommand($command) 
{ 
        $client = new SoapClient(NULL, 
        array( 
                "location" => "http://".$this->soapSettings['IP'].":".$this->soapSettings['PORT']."/", 
                "uri" => "urn:RC",  //RibonCore namespace 
                "style" => SOAP_RPC, 
                "login" => $this->soapSettings['USERNAME'], 
                "password" => $this->soapSettings['PASSWORD'], 
        )); 
 
 
        try //Try to execute function 
        { 
                $result = $client->executeCommand(new SoapParam($command, "command")); 
        } 
        catch(Exception $e) //Don't give fatal error if there is a problem 
        { 
                return array('sent'=>false, 'message'=>$e->getMessage()); 
        } 
        return array('sent'=>true, 'message'=>$result); 
}
?>
